{% extends 'base.html' %}

{% block title %}Upload{% endblock %}
{% block header-title %}Upload A File{% endblock %}

{% block sidebar %}
<h2>Mediasnak<br>is free.</h2>
<p>However, it still costs us money to safely and securely store your media files.</p>
<p>If you like Mediasnak and find it useful, please donate to keep the project going.</p>

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="ZKZ22W2N6N9X8">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_AU/i/scr/pixel.gif" width="1" height="1">
</form>
{% endblock %}

{% block content %}
<div style="text-align: center;">
<form action="http://s3.mediasnak.com/" method="post" enctype="multipart/form-data">
<input type="hidden" name="key" value="{{ key }}">
<input type="hidden" name="acl" value="private">
<input type="hidden" name="Content-Type" value="application/octet-stream">
<input type="hidden" name="Content-Disposition" value="inline; filename=${filename}">
<input type="hidden" name="x-amz-meta-filename" value="${filename}">
<input type="hidden" name="x-amz-meta-userid" value="{{ user_id }}">
<input type="hidden" name="success_action_redirect" value="http://{{ return_host }}/success">
<input type="hidden" name="AWSAccessKeyId" value="{{ aws_id }}">
<input type="hidden" name="policy" value="{{ policy }}">
<input type="hidden" name="signature" value="{{ signature }}">
<p>Step 1: Select your file<br><input type="file" name="file" size="40"></p>
<p>Step 2: Click to upload<br><input name="submit" value="Secure Upload" type="submit"></p>
</form>
</div>
<hr>

{% endblock %}
